const { Client } = require('discord.js');
const mongoose = require('mongoose');
const { DATABASE } = require('../../Structures/config.json');

module.exports = {
  name: 'ready',
  once: true,
  /**
   * @param {Client} client
   */
  execute(client) {
    console.log(`Ready! Logged in as ${client.user.tag}`);
    client.user.setActivity('мемесы', { type: 'WATCHING' });

    if (!DATABASE) return;
    mongoose
      .connect(DATABASE, {
        useNewURLParser: true,
        useUnifiedTopology: true,
      })
      .then(() => {
        console.log('The Client is now connected to the database!');
      })
      .catch(err => console.log(err));
  },
};
